﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8" />
    <title>TrafficLight: StateForge::Examples::TrafficLight::TrafficLight Class Reference</title>
    <link href="/Content/Help.css" rel="stylesheet" type="text/css" />
    <link href="/Content/css/tabs.css" rel="stylesheet" type="text/css" />
    <link href="/Content/css/doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div id="header">
        <img id="logo" alt="StateForge" src="/Content/Images/StateForgeLogo.png" />
        <div id="title">
            <h1>
                C# examples using state machines generated by StateBuilderDotNet
            </h1>
            <h3>
                TrafficLight: StateForge::Examples::TrafficLight::TrafficLight Class Reference
            </h3>
        </div>
        <div id="menucontainer">
            <ul id="menu">
                <li><a href="/">Home</a></li>
                <li><a href="/Home/Download">Downloads</a></li>
                <li><a href="/Help/state-machine-tools.aspx">Help</a></li>
                <li><a href="/Home/Faq">F.A.Q</a></li>
                <li><a href="/Home/About">Contact us</a></li>
            </ul>
        </div>
    </div>
<!-- Generated by Doxygen 1.7.4 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="namespace_state_forge.html">StateForge</a>      </li>
      <li class="navelem"><a class="el" href="namespace_state_forge_1_1_examples.html">Examples</a>      </li>
      <li class="navelem"><a class="el" href="namespace_state_forge_1_1_examples_1_1_traffic_light.html">TrafficLight</a>      </li>
      <li class="navelem"><a class="el" href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_traffic_light.html">TrafficLight</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pri-methods">Private Member Functions</a> &#124;
<a href="#pri-static-methods">Static Private Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="#pri-static-attribs">Static Private Attributes</a>  </div>
  <div class="headertitle">
<div class="title">StateForge::Examples::TrafficLight::TrafficLight Class Reference</div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="StateForge::Examples::TrafficLight::TrafficLight" -->
<p><a class="el" href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_traffic_light.html" title="TrafficLight is a container class which hold instances of a TrafficLightActuator and a generated Traf...">TrafficLight</a> is a container class which hold instances of a TrafficLightActuator and a generated TrafficLightContext class.  
 <a href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_traffic_light.html#details">More...</a></p>

<p><a href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_traffic_light-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_traffic_light.html#a92c91550251282b86202d19cfb655df3">TrafficLight</a> ()</td></tr>
<tr><td colspan="2"><h2><a name="pri-methods"></a>
Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_traffic_light.html#a1235447b540d56802f1e854d9e22c0b2">StateMachineEnd</a> (object sender, EventArgs e)</td></tr>
<tr><td colspan="2"><h2><a name="pri-static-methods"></a>
Static Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_traffic_light.html#a777384d94d2ebe441761a02efcedc780">Main</a> (string[] args)</td></tr>
<tr><td colspan="2"><h2><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_light.html">Light</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_traffic_light.html#ae8acc5adf832db77605b4ca0a581ecec">light</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">TrafficLightContext&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_traffic_light.html#aa193cbc9ee91c3fdaab62721279912ff">context</a></td></tr>
<tr><td colspan="2"><h2><a name="pri-static-attribs"></a>
Static Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static readonly string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_traffic_light.html#a0d98f8e228c54d9f24f1385b6a43c171">traceName</a> = &quot;TrafficLight&quot;</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static TraceSource&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_traffic_light.html#a24f149c0a56e0dd08e3d990cde18e038">ts</a> = new TraceSource(<a class="el" href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_traffic_light.html#a0d98f8e228c54d9f24f1385b6a43c171">traceName</a>)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static AutoResetEvent&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_traffic_light.html#aab20f486ca9f003e7b92ce13824f53d0">autoResetEvent</a> = new AutoResetEvent(false)</td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p><a class="el" href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_traffic_light.html" title="TrafficLight is a container class which hold instances of a TrafficLightActuator and a generated Traf...">TrafficLight</a> is a container class which hold instances of a TrafficLightActuator and a generated TrafficLightContext class. </p>

<p>Definition at line <a class="el" href="_traffic_light_8cs_source.html#l00076">76</a> of file <a class="el" href="_traffic_light_8cs_source.html">TrafficLight.cs</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a92c91550251282b86202d19cfb655df3"></a><!-- doxytag: member="StateForge::Examples::TrafficLight::TrafficLight::TrafficLight" ref="a92c91550251282b86202d19cfb655df3" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">StateForge::Examples::TrafficLight::TrafficLight::TrafficLight </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_traffic_light_8cs_source.html#l00084">84</a> of file <a class="el" href="_traffic_light_8cs_source.html">TrafficLight.cs</a>.</p>
<div class="fragment"><pre class="fragment">        {
            this.<a class="code" href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_traffic_light.html#ae8acc5adf832db77605b4ca0a581ecec">light</a> = <span class="keyword">new</span> Light();
            this.<a class="code" href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_traffic_light.html#aa193cbc9ee91c3fdaab62721279912ff">context</a> = <span class="keyword">new</span> TrafficLightContext(<a class="code" href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_traffic_light.html#ae8acc5adf832db77605b4ca0a581ecec">light</a>);
            this.<a class="code" href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_traffic_light.html#aa193cbc9ee91c3fdaab62721279912ff">context</a>.Observer = ObserverTrace.Instance(<a class="code" href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_traffic_light.html#a0d98f8e228c54d9f24f1385b6a43c171">traceName</a>);
            this.<a class="code" href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_traffic_light.html#aa193cbc9ee91c3fdaab62721279912ff">context</a>.EndHandler += <span class="keyword">new</span> EventHandler&lt;EventArgs&gt;(<a class="code" href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_traffic_light.html#a1235447b540d56802f1e854d9e22c0b2">StateMachineEnd</a>);
            this.<a class="code" href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_traffic_light.html#aa193cbc9ee91c3fdaab62721279912ff">context</a>.EnterInitialState();
        }
</pre></div>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a777384d94d2ebe441761a02efcedc780"></a><!-- doxytag: member="StateForge::Examples::TrafficLight::TrafficLight::Main" ref="a777384d94d2ebe441761a02efcedc780" args="(string[] args)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static void StateForge::Examples::TrafficLight::TrafficLight::Main </td>
          <td>(</td>
          <td class="paramtype">string[]&#160;</td>
          <td class="paramname"><em>args</em></td><td>)</td>
          <td><code> [inline, static, private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_traffic_light_8cs_source.html#l00099">99</a> of file <a class="el" href="_traffic_light_8cs_source.html">TrafficLight.cs</a>.</p>
<div class="fragment"><pre class="fragment">        {
            <a class="code" href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_traffic_light.html#a92c91550251282b86202d19cfb655df3">TrafficLight</a> myTrafficLight = <span class="keyword">new</span> <a class="code" href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_traffic_light.html#a92c91550251282b86202d19cfb655df3">TrafficLight</a>();
            myTrafficLight.Start(<span class="stringliteral">&quot;Ciao&quot;</span>);
            <a class="code" href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_traffic_light.html#aab20f486ca9f003e7b92ce13824f53d0">autoResetEvent</a>.WaitOne();
            <a class="code" href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_traffic_light.html#a24f149c0a56e0dd08e3d990cde18e038">ts</a>.TraceInformation(<span class="stringliteral">&quot;TrafficLight has ended&quot;</span>);
            Environment.Exit(0);
        }
</pre></div>
</div>
</div>
<a class="anchor" id="a1235447b540d56802f1e854d9e22c0b2"></a><!-- doxytag: member="StateForge::Examples::TrafficLight::TrafficLight::StateMachineEnd" ref="a1235447b540d56802f1e854d9e22c0b2" args="(object sender, EventArgs e)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void StateForge::Examples::TrafficLight::TrafficLight::StateMachineEnd </td>
          <td>(</td>
          <td class="paramtype">object&#160;</td>
          <td class="paramname"><em>sender</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">EventArgs&#160;</td>
          <td class="paramname"><em>e</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline, private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_traffic_light_8cs_source.html#l00093">93</a> of file <a class="el" href="_traffic_light_8cs_source.html">TrafficLight.cs</a>.</p>
<div class="fragment"><pre class="fragment">        {
            <a class="code" href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_traffic_light.html#a24f149c0a56e0dd08e3d990cde18e038">ts</a>.TraceInformation(<span class="stringliteral">&quot;state machine has ended&quot;</span>);
            <a class="code" href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_traffic_light.html#aab20f486ca9f003e7b92ce13824f53d0">autoResetEvent</a>.Set();
        }
</pre></div>
</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="aab20f486ca9f003e7b92ce13824f53d0"></a><!-- doxytag: member="StateForge::Examples::TrafficLight::TrafficLight::autoResetEvent" ref="aab20f486ca9f003e7b92ce13824f53d0" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">AutoResetEvent <a class="el" href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_traffic_light.html#aab20f486ca9f003e7b92ce13824f53d0">StateForge::Examples::TrafficLight::TrafficLight::autoResetEvent</a> = new AutoResetEvent(false)<code> [static, private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_traffic_light_8cs_source.html#l00082">82</a> of file <a class="el" href="_traffic_light_8cs_source.html">TrafficLight.cs</a>.</p>

</div>
</div>
<a class="anchor" id="aa193cbc9ee91c3fdaab62721279912ff"></a><!-- doxytag: member="StateForge::Examples::TrafficLight::TrafficLight::context" ref="aa193cbc9ee91c3fdaab62721279912ff" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TrafficLightContext <a class="el" href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_traffic_light.html#aa193cbc9ee91c3fdaab62721279912ff">StateForge::Examples::TrafficLight::TrafficLight::context</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_traffic_light_8cs_source.html#l00079">79</a> of file <a class="el" href="_traffic_light_8cs_source.html">TrafficLight.cs</a>.</p>

</div>
</div>
<a class="anchor" id="ae8acc5adf832db77605b4ca0a581ecec"></a><!-- doxytag: member="StateForge::Examples::TrafficLight::TrafficLight::light" ref="ae8acc5adf832db77605b4ca0a581ecec" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_light.html">Light</a> <a class="el" href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_traffic_light.html#ae8acc5adf832db77605b4ca0a581ecec">StateForge::Examples::TrafficLight::TrafficLight::light</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_traffic_light_8cs_source.html#l00078">78</a> of file <a class="el" href="_traffic_light_8cs_source.html">TrafficLight.cs</a>.</p>

</div>
</div>
<a class="anchor" id="a0d98f8e228c54d9f24f1385b6a43c171"></a><!-- doxytag: member="StateForge::Examples::TrafficLight::TrafficLight::traceName" ref="a0d98f8e228c54d9f24f1385b6a43c171" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">readonly string <a class="el" href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_traffic_light.html#a0d98f8e228c54d9f24f1385b6a43c171">StateForge::Examples::TrafficLight::TrafficLight::traceName</a> = &quot;TrafficLight&quot;<code> [static, private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_traffic_light_8cs_source.html#l00080">80</a> of file <a class="el" href="_traffic_light_8cs_source.html">TrafficLight.cs</a>.</p>

</div>
</div>
<a class="anchor" id="a24f149c0a56e0dd08e3d990cde18e038"></a><!-- doxytag: member="StateForge::Examples::TrafficLight::TrafficLight::ts" ref="a24f149c0a56e0dd08e3d990cde18e038" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TraceSource <a class="el" href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_traffic_light.html#a24f149c0a56e0dd08e3d990cde18e038">StateForge::Examples::TrafficLight::TrafficLight::ts</a> = new TraceSource(<a class="el" href="class_state_forge_1_1_examples_1_1_traffic_light_1_1_traffic_light.html#a0d98f8e228c54d9f24f1385b6a43c171">traceName</a>)<code> [static, private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_traffic_light_8cs_source.html#l00081">81</a> of file <a class="el" href="_traffic_light_8cs_source.html">TrafficLight.cs</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="_traffic_light_8cs_source.html">TrafficLight.cs</a></li>
</ul>
</div>
﻿<div id="footer">
    <hr />
    <p>
        Copyright &copy; 2011 StateForge.</p>
    <hr />
</div>
</body> </html> 
